package com.whq.thrift.api.gateway.db;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import com.whq.common.StringUtil;

public class MethodInfo implements Serializable {
	private static final long serialVersionUID = 1L;

	private int id;
	private String methodName;
	private int isTob;
	private int needVerifyTicket;
	private String verifyModuleId;
	private String verifyModuleMethod;
	private String signatureIgnoreParams;
	private int methodStatus;
	private int timeoutMs = 0;
	private long maxRunCountPreSecond = 0;
	private String methodModuleId;
	
	public Set<String> getSignatureIgnoreParamsSet() {
		Set<String> ret = StringUtil.split2set(signatureIgnoreParams, ",");
		if (ret == null) {
			ret = new HashSet<String>(0);
		}
		return ret;
	}
	
	public boolean isTob() {
		return isTob == 1;
	}
	
	public boolean isNeedVerifyTicket() {
		return needVerifyTicket == 1;
	}
	
	public String getVerifyModuleMethod() {
		return verifyModuleMethod;
	}

	public void setVerifyModuleMethod(String verifyModuleMethod) {
		this.verifyModuleMethod = verifyModuleMethod;
	}

	public String getVerifyModuleId() {
		return verifyModuleId;
	}

	public void setVerifyModuleId(String verifyModuleId) {
		this.verifyModuleId = verifyModuleId;
	}

	public String getSignatureIgnoreParams() {
		return signatureIgnoreParams;
	}

	public void setSignatureIgnoreParams(String signatureIgnoreParams) {
		this.signatureIgnoreParams = signatureIgnoreParams;
	}

	public int getMethodStatus() {
		return methodStatus;
	}

	public void setMethodStatus(int methodStatus) {
		this.methodStatus = methodStatus;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getMethodName() {
		return methodName;
	}

	public void setMethodName(String methodName) {
		this.methodName = methodName;
	}

	public int getIsTob() {
		return isTob;
	}

	public void setIsTob(int isTob) {
		this.isTob = isTob;
	}

	public int getNeedVerifyTicket() {
		return needVerifyTicket;
	}

	public void setNeedVerifyTicket(int needVerifyTicket) {
		this.needVerifyTicket = needVerifyTicket;
	}

	public int getTimeoutMs() {
		return timeoutMs;
	}

	public void setTimeoutMs(int timeoutMs) {
		this.timeoutMs = timeoutMs;
	}

	public long getMaxRunCountPreSecond() {
		return maxRunCountPreSecond;
	}

	public void setMaxRunCountPreSecond(long maxRunCountPreSecond) {
		this.maxRunCountPreSecond = maxRunCountPreSecond;
	}
	
	public String getMethodModuleId() {
		return methodModuleId;
	}

	public void setMethodModuleId(String methodModuleId) {
		this.methodModuleId = methodModuleId;
	}

	public String toString() {
		StringBuilder buf = new StringBuilder(30);
		buf.append("{");
		buf.append(id);
		buf.append(",");
		buf.append(methodName);
		buf.append(",");
		buf.append(",");
		buf.append(isTob);
		buf.append(",");
		buf.append(needVerifyTicket);
		buf.append(",");
		buf.append("}");
		return buf.toString();
	}
}
